package com.jinyijia.api.rest.v1.dto;

import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Pattern;
import java.util.HashSet;
import java.util.Set;

/**
 * @author lhw
 * @date 2018/8/18
 **/
@Data
public class UserDTO {

    @NotBlank(message = "用户名不能为空.")
    private String username;
    @NotBlank(message = "密码不能为空.")
    private String password;
    private String userCode;
    @Pattern(regexp = "^1(3|4|5|7|8)\\d{9}$", message = "手机号码格式错误.")
    @NotBlank(message = "手机号码不能为空.")
    private String mobile;
    private Set<String> authorities = new HashSet<>();
    private boolean enabled = true;
    @NotBlank(message = "邀请码不能为空.")
    private String invitCode;
    private Integer verificationCode;

}
